﻿<%@ Control Language="C#" AutoEventWireup="true" Codebehind="RoleManagement.ascx.cs"
    Inherits="Portal.Administrator.Roles.RoleManagement" %>
<%@ Register Assembly="Framework.WebControl" Namespace="Framework.WebControls"
    TagPrefix="cc2" %>
<%@ Register Assembly="Framework.Module.MultiLanguage" Namespace="Framework.Module.MultiLanguage.WebControls"
    TagPrefix="cc1" %>
<%@ Register Assembly="System.Web.Extensions" Namespace="System.Web.UI" TagPrefix="asp" %>

<table border="0" cellpadding="0" cellspacing="1" class="content" width="100%">    
    <tr>
        <td class="postheader" width="60%" align="left" valign="top">
            <asp:UpdatePanel ID="upanelRoleManagement" runat="server" UpdateMode="Conditional"
                RenderMode="Inline">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnUpdate" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="btnAdd" EventName="Click" />                    
                </Triggers>
                <ContentTemplate>
                    <table class="content" cellspacing="1" cellpadding="0" width="100%">                        
                        <tr>
                            <td class="header2" style="height: 19px" align="left" width="40%">
                                Group</td>
                            <td class="header2" style="height: 19px" align="left" width="45%">
                                Description</td>
                            <td class="header2" style="height: 19px" align="left" width="15%">
                                Action</td>                           
                        </tr>
                        <asp:Repeater ID="dtgRoles" runat="server" OnItemCommand="dtgRoles_ItemCommand">
                            <ItemTemplate>
                                <tr>
                                    <td class="post" align="left">
                                        <asp:LinkButton ID="NameEdit" runat="server" CommandName="editrole" CommandArgument='<%# Eval("RoleID") %>'
                                            Text='<%# Eval("RoleName") %>' /></td> 
                                    <td class="post" align="left">
                                        <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("RoleDescription") %>'></asp:Label></td>                                   
                                    <td class="post" align="left">
                                        <ImageButton:Update ID="btnEditRole" ImageUrl="~/Administrator/Resource/Images/GridView/edit.png" runat="server" CommandArgument='<%# Eval("RoleID") %>' CommandName="editrole" ToolTip="Sửa" />                                        
                                        &nbsp;                                        
                                        <ImageButton:Delete ID="btnDeleteRole" ImageUrl="~/Administrator/Resource/Images/GridView/delete.png" runat="server" CommandArgument='<%# Eval("RoleID") %>' CommandName="deleterole" ToolTip="Xóa" />
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater> 
                        <tr>
                            <td class="postfooter" colspan="3" align="left">
                                <Button:Create runat="server" CssClass="pbutton" ID="btnMember" Text="Thành viên" Width="85px" OnClick="btnMember_Click" />
                                &nbsp;
                                <Button:Update runat="server" CssClass="pbutton" ID="btnPermission" Text="Phân quyền" Width="85px" OnClick="btnPermission_Click" />
                            </td>
                        </tr>
                    </table>                    
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>        
        <td class="post" width="40%" align="left" valign="top">
            <asp:UpdatePanel ID="upanelRoleManagement1" runat="server" UpdateMode="Conditional"
                RenderMode="Inline">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnUpdate" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="btnAdd" EventName="Click" />                    
                    <asp:AsyncPostBackTrigger ControlID="btnCancel" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="dtgRoles" EventName="ItemCommand" />
                </Triggers>
                <ContentTemplate>
                    <table width="100%" cellspacing="1" cellpadding="0" border="0" class="content">
                        <tr>
                            <td class="header1" align="left" colspan="2">
                                <asp:Label ID="lblCommandName" runat="server"></asp:Label>
                            </td>
                        </tr>
                        <tr>                            
                            <td colspan="2" class="header2" height="18">
                                <asp:Label ID="lblUpdate" runat="server" ForeColor="Blue"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="postheader" width="30%" align="left">
                                <asp:Label ID="lblCode" runat="server" Text="Mã" ></asp:Label></td>
                            <td class="post" width="75%" align="left">
                                <asp:TextBox ID="txtRoleID" runat="server" Enabled="False" Width="46px" ></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td class="postheader" width="30%" align="left">
                                <asp:Label ID="lblGroup" runat="server" Text="Group" ></asp:Label></td>
                            <td class="post" width="75%" align="left">
                                <asp:TextBox ID="txtRoleName" runat="server" CssClass="inputTextBox150"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td class="postheader" width="30%" align="left">
                                <asp:Label ID="lblDescription" runat="server" Text="Mô tả" ></asp:Label></td>
                            <td class="post" width="75%" align="left">
                                <asp:TextBox ID="txtRoleDescription" runat="server" Height="60px" TextMode="MultiLine"  CssClass="inputTextBox150"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td class="postheader" width="30%" align="left">
                                <asp:Label ID="lblRoleParentID" runat="server" Text="Nhóm cha"></asp:Label></td>
                            <td class="post" width="75%" align="left">
                                <asp:DropDownList ID="dropRoleParentID" runat="server" DataTextField="RoleName" DataValueField="RoleID">
                                </asp:DropDownList></td>
                        </tr>
                        <tr>
                            <td class="postfooter" colspan="2" valign="middle" align="center">
                                <Button:Update ID="btnUpdate" runat="server" OnClick="btnUpdate_Click" Text="Cập nhật" CssClass="pbutton" Width="77px"  />
                                <Button:Create ID="btnAdd" runat="server" OnClick="btnAdd_Click" Text="Thêm mới" CssClass="pbutton" Width="77px" />                        
                                <asp:Button ID="btnCancel" runat="server" CssClass="pbutton" Text="Huỷ" Width="77px" OnClick="btnCancel_Click" />
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
    </tr> 
</table>
